package com.skt.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.skt.domain.PO.UploadedFile;
import com.skt.domain.VO.FilePublicUrlVO;
import com.skt.domain.VO.FileUploadVO;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.Positive;

public interface FileService extends IService<UploadedFile> {
    /**
     * 上传图片
     * @param file
     * @param securityContext
     * @return
     */
    FileUploadVO uploadImage(MultipartFile file, SecurityContext securityContext);

    /**
     * 获取文件的公开访问 URL
     * @param fileId
     * @return
     */
    FilePublicUrlVO getPublicFileUrl(@Positive(message = "文件 ID 必须为正整数") Long fileId);
}
